package com.speedchina.common.message.util;
import lombok.Data;

/**
 *  消息返回响应代码
 * @author zyw
 */
@Data
public class SendResult {
    private boolean isSuccess;
    private Integer errorCode;
    private String errorMsg;
    private String successMsg;
    public SendResult SendSucess( boolean isSuccess, Integer errorCode,String errorMsg){
        SendResult sendResult = new SendResult();
        sendResult.setSuccess(isSuccess);
        sendResult.setErrorCode(errorCode);
        sendResult.setErrorMsg(errorMsg);
        return sendResult;
    }
    public SendResult SendSucess(boolean isSuccess,String successMsg){
        SendResult sendResult = new SendResult();
        sendResult.setSuccess(isSuccess);
        sendResult.setSuccessMsg(successMsg);
        sendResult.setErrorCode(0);
        sendResult.setErrorMsg("0");
        return sendResult;
    }
    public SendResult SendFail(boolean isSuccess,String errorMsg){
        SendResult sendResult = new SendResult();
        sendResult.setSuccess(isSuccess);
        sendResult.setSuccessMsg(successMsg);
        sendResult.setErrorCode(1);
        sendResult.setErrorMsg(errorMsg);
        return sendResult;
    }
}
